===== Source code =====
function jwSpeakRight(jw)
{
var el=document.getElementById(jw.id);
if (el) {
var speaker=jw.speaker ? jw.speaker: 'jokuwiki';
var c='\n';
c+='\n' + jw.say + '
\n
';
c+='\n' + speaker + '
';
el.innerHTML+=c;
return true;
}
return false;
}
if (jokuwiki) {
jokuwiki.register('jwHelloWorld', jwSpeakRight);
}
{
"type":"object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://www.dokuwiki.org/plugin:jwHelloWorld/schema.json",
"required":false,
"properties":{
"speaker": {
"type":"string",
"description": "Appears below the speak bubble",
"id": "http://www.dokuwiki.org/plugin:jwHelloWorld/helloFrom",
"required":false
},
"say": {
"type":"string",
"description": "Text to go inside the speak bubble",
"id": "http://www.dokuwiki.org/plugin:jwHelloWorld/helloTo",
"required":true
}
}
}
/* Note that the contianing div class uses the jokuwiki name */
div.dokuwiki .jwHelloWorld {
float:right; min-width: 20%; max-width: 30%; padding: 0.6em;
}
/* the rest is just styling sugar */
div.dokuwiki .speak-right {
position:relative;
padding:15px 30px 15px 30px;
margin:0.5em;
color:#000;
font-weight: bold;
font-size: 120%;
background: #d1b000;
/* Using longhand to avoid inconsistencies between Safari 4 and Chrome 4 */
-webkit-border-top-left-radius:25px 50px;
-webkit-border-top-right-radius:25px 50px;
-webkit-border-bottom-right-radius:25px 50px;
-webkit-border-bottom-left-radius:25px 50px;
-moz-border-radius:25px / 50px;
border-radius:25px / 50px;
}
div.dokuiwki .speak-right-p {
display: block;
margin:10px 0.5em 2em 80px;
text-align:left;
font-style:italic;
font-weight: bold;
font-size: 120%
}
div.dokuwiki .speak-right:before {
content:"";
position:absolute;
bottom:-30px;
left:40px;
/* */
border-width:0 50px 30px 0;
border-style:solid;
border-color:transparent #d1b000;
/* reduce the damage in FF3.0 */
display:block;
width:0;
}
div.dokuwiki .speak-right:after {
content:"";
position:absolute;
bottom:-30px;
left:70px;
border-width:0 20px 30px 0;
border-style:solid;
border-color:transparent #fff;
/* reduce the damage in FF3.0 */
display:block;
width:0;
}
div.dokuwiki .speak-right-speaker {
margin:20px 0.5em 2em 110px; text-align:left; font-style:italic; font-size:120%;
}